<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/commons/global.jsp"%>
<script type="text/javascript">
	$(function() {
        $('#shopGoodsAddForm').form({
            url : '${path}/shopGoods/add',
            onSubmit : function() {
                progressLoad();
                var isValid = $(this).form('validate');
                if (!isValid) {
                    progressClose();
                }
                return isValid;
            },
            success : function(result) {
                progressClose();
                result = $.parseJSON(result);
                if (result.success) {
                    //之所以能在这里调用到parent.$.modalDialog.openner_dataGrid这个对象，是因为user.jsp页面预定义好了
                    parent.$.modalDialog.openner_dataGrid.datagrid('reload');
                    parent.$.modalDialog.handler.dialog('close');
                } else {
                    var form = $('#shopGoodsAddForm');
                    parent.$.messager.alert('错误', eval(result.msg), 'error');
                }
            }
        });
         $('#goodCategoryId').combotree({
            url : '${path }/shopGoods/allCategory',
            parentField : 'categoryParentId',
            lines : true,
            panelHeight : 'auto'
        });
    });
</script>
<div class="easyui-layout" data-options="fit:true,border:false">
	<div data-options="region:'center',border:false"
		style="overflow: hidden;padding: 3px;">
		<form id="shopGoodsAddForm" method="post">
			<table class="grid">
				<tr>
					<td>商品名称</td>
					<td><input type="text" name="goodName"
						class="easyui-validatebox" required="required" />
					</td>
				</tr>
				<tr>
					<td>商品号</td>
					<td><input type="text" name="goodCode"
						class="easyui-validatebox" />
					</td>
				</tr>
				<tr>
					<td>商品类别</td>
					<td><select id="goodCategoryId" name="categoryParentId"
						style="width: 140px; height: 29px;" class="easyui-validatebox"
						data-options="required:true"></select></td>
				</tr>
				<tr>
					<td>商品主标题</td>
					<td><input type="text" name="goodParentTitle"
						class="easyui-validatebox" required="required" />
					</td>
				</tr>
				<tr>
					<td>商品副标题</td>
					<td><input type="text" name="goodSubTitle"
						class="easyui-validatebox" required="required" />
					</td>
				</tr>
				<tr>
					<td>商品价格(分)</td>
					<td><input type="text" name="goodPrice"
						class="easyui-numberbox" />
					</td>
				</tr>
				<tr>
					<td>商品描述</td>
					<td><input type="text" name="goodDescription"
						class="easyui-validatebox" />
					</td>
				</tr>
				<tr>
					<td>库存数量</td>
					<td><input type="text" name="goodNum" class="easyui-numberbox" />
					</td>
				</tr>

				<tr>
					<td>商品条形码</td>
					<td><input type="text" name="goodBarcode"
						class="easyui-validatebox" />
					</td>
				</tr>
				<tr>
					<td>商品状态(1-正常，2-下架，3-删除)</td>
					<td><input type="text" name="goodStatus"
						class="easyui-numberbox" />
					</td>
				</tr>
				<tr>
					<td>商品卖点</td>
					<td><input type="text" name="sellPoint"
						class="easyui-numberbox" />
					</td>
				</tr>
				<tr>
					<td>商品排序值</td>
					<td><input type="text" name="goodOrder"
						class="easyui-numberspinner" value="1" required="required"
						data-options="editable:false" />
					</td>
				</tr>
				<tr>
					<td>折扣率(1-100)</td>
					<td><input type="text" name="depositRate"
						class="easyui-numberbox" />
					</td>
				</tr>
			</table>
		</form>
	</div>
</div>